import {
  GET_DETAIL
} from './constants'
import Axios from 'axios'
const getDetail = data => ({
  type: GET_DETAIL,
  detail: data 
})
export const getDetailInfo = (id) => {
  return dispatch => {
    Axios.get('/api/detail.json?id=' +id).then(res => {
      if (res.data.success) {
        dispatch(getDetail(res.data.data))
      }
    })
  }
}